package com.kwin.excel.head;

import java.util.List;
import java.util.Set;

/**
 * @author : wangkai
 * @version V1.0
 * @Package com.kwin.excel.head
 * @Description:
 * @date 2021年10月19日 10:06
 **/
public class HeadMeta {
    private List<List<String>> head;
    private Set<String> ignoreHeadFields;
    
    public HeadMeta() {
    }
    
    public List<List<String>> getHead() {
        return this.head;
    }
    
    public Set<String> getIgnoreHeadFields() {
        return this.ignoreHeadFields;
    }
    
    public void setHead(final List<List<String>> head) {
        this.head = head;
    }
    
    public void setIgnoreHeadFields(final Set<String> ignoreHeadFields) {
        this.ignoreHeadFields = ignoreHeadFields;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof HeadMeta)) {
            return false;
        } else {
            HeadMeta other = (HeadMeta)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$head = this.getHead();
                Object other$head = other.getHead();
                if (this$head == null) {
                    if (other$head != null) {
                        return false;
                    }
                } else if (!this$head.equals(other$head)) {
                    return false;
                }
                
                Object this$ignoreHeadFields = this.getIgnoreHeadFields();
                Object other$ignoreHeadFields = other.getIgnoreHeadFields();
                if (this$ignoreHeadFields == null) {
                    if (other$ignoreHeadFields != null) {
                        return false;
                    }
                } else if (!this$ignoreHeadFields.equals(other$ignoreHeadFields)) {
                    return false;
                }
                
                return true;
            }
        }
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof HeadMeta;
    }
    
    @Override
    public int hashCode() {
//        int PRIME = true;
        int result = 1;
        Object head = this.getHead();
        result = result * 59 + (head == null ? 43 : head.hashCode());
        Object ignoreHeadFields = this.getIgnoreHeadFields();
        result = result * 59 + (ignoreHeadFields == null ? 43 : ignoreHeadFields.hashCode());
        return result;
    }
    
    @Override
    public String toString() {
        return "HeadMeta(head=" + this.getHead() + ", ignoreHeadFields=" + this.getIgnoreHeadFields() + ")";
    }
}
